package Text::Pipe::Translate::Babelfish;

use strict;
use warnings;
use LWP::UserAgent;


our $VERSION = '0.03';


use base qw(Text::Pipe::Translate);


sub init {
    my $self = shift;
    $self->SUPER::init(@_);

    Lingua::Translate::config(
        back_end      => "Babelfish",
        babelfish_uri => 'http://babelfish.altavista.com/tr?',
        ua            => LWP::UserAgent->new,
    );

}


1;


__END__

{% USE p = PodGenerated %}

=head1 NAME

{% p.package %} - Translate text using Babelfish

=head1 SYNOPSIS

    use Text::Pipe 'pipe';
    my $pipe = pipe 'Translate::Babelfish', from => 'en', to => 'de';
    my $german = $pipe->filter('My hovercraft is full of eels.'),

=head1 DESCRIPTION

This pipe segment can translate text from one language to another. To do so it
uses L<Lingua::Translate>'s Babelfish backend.

=head1 METHODS

=over 4

{% p.write_methods %}

=item init

Instructs L<Lingua::Translate> to use the C<Babelfish> backend.

=back

{% p.write_inheritance %}

{% PROCESS standard_pod %}

=cut

